package com.numbfish.ch16_ex08_r2dbc_web_flux.repository;

import com.numbfish.ch16_ex08_r2dbc_web_flux.pojo.Person;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

import java.util.Collection;

@Repository
public interface PersonRepository extends R2dbcRepository<Person,Integer> {
    // 仅限单表简单查询
    Flux<Person> findAllByIdInAndNameLike(Collection<Integer> id,String name);

    // 自定义 @Query SQL
    @Query("select * from person")
    Flux<Person> findHaha();
}
